import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../extension/ex_color.dart';

/// 应用颜色
class AppColors {
  /// *******************************************
  /// 自定义 颜色
  /// *******************************************

  /// 通用白色底(深色为黑色底)
  static Color get whiteBackground => fixDark('#2c2c2c', '#FFFFFF');

  /// 通用黑色字体(深色为白色字体)
  static Color get blackContent => fixDark('#FFFFFF','#2c2c2c');

  /// 页面背景颜色
  static const Color scaffoldBackground = Color(0xFFFFFFFF);

  /// 按钮背景色
  static const Color buttonBackground = Color(0xFF4FDDB3);

  /// 主要文本颜色
  static const Color primaryText = Color(0xFF1E1E1E);

  /// 次要文本颜色
  static const Color secondaryText = Color(0xFF333333);
  static const Color inputPlaceholder = Color(0xFF555555);

  /// 高亮颜色
  static const Color accentColor = Color(0xFF5C78FF);

  /// 次要颜色
  static const Color secondaryColor = Color(0xFFDEE3FF);

  /// 警告颜色
  static const Color warnColor = Color(0xFFFFB822);

  /// 边框颜色
  static const Color borderColor = Color(0xFFDEE3FF);

  static const Color pinkColor = Color(0xFFF77866);

  static const Color yellowColor = Color(0xFFFFB822);

  /// *******************************************
  /// Material System
  /// *******************************************

  static Color get background => Get.theme.colorScheme.background;

  static Brightness get brightness => Get.theme.colorScheme.brightness;

  static Color get error => Get.theme.colorScheme.error;

  static Color get errorContainer => Get.theme.colorScheme.errorContainer;

  static Color get inversePrimary => Get.theme.colorScheme.inversePrimary;

  static Color get inverseSurface => Get.theme.colorScheme.inverseSurface;

  static Color get onBackground => Get.theme.colorScheme.onBackground;

  static Color get onError => Get.theme.colorScheme.onError;

  static Color get onErrorContainer => Get.theme.colorScheme.onErrorContainer;

  static Color get onInverseSurface => Get.theme.colorScheme.onInverseSurface;

  static Color get onPrimary => Get.theme.colorScheme.onPrimary;

  static Color get onPrimaryContainer =>
      Get.theme.colorScheme.onPrimaryContainer;

  static Color get onSecondary => Get.theme.colorScheme.onSecondary;

  static Color get onSecondaryContainer =>
      Get.theme.colorScheme.onSecondaryContainer;

  static Color get onSurface => Get.theme.colorScheme.onSurface;

  static Color get onSurfaceVariant => Get.theme.colorScheme.onSurfaceVariant;

  static Color get onTertiary => Get.theme.colorScheme.onTertiary;

  static Color get onTertiaryContainer =>
      Get.theme.colorScheme.onTertiaryContainer;

  static Color get outline => Get.theme.colorScheme.outline;

  static Color get primary => Get.theme.colorScheme.primary;

  static Color get primaryContainer => Get.theme.colorScheme.primaryContainer;

  static Color get secondary => Get.theme.colorScheme.secondary;

  static Color get secondaryContainer =>
      Get.theme.colorScheme.secondaryContainer;

  static Color get shadow => Get.theme.colorScheme.shadow;

  static Color get surface => Get.theme.colorScheme.surface;

  static Color get surfaceVariant => Get.theme.colorScheme.surfaceVariant;

  static Color get tertiary => Get.theme.colorScheme.tertiary;

  static Color get tertiaryContainer => Get.theme.colorScheme.tertiaryContainer;

  /// 暗黑色自定义适配(十六进制色值,字符串'#707070'或者'707070')
  /// [dark]  深色模式色值
  /// [light] 浅色模式色值
  static Color fixDark(String dark, String light){
    return Get.isDarkMode ? ExColor.hexColor(dark) : ExColor.hexColor(light);
  }

  /// 暗黑色自定义适配颜色
  /// [darkColor]  深色模式颜色
  /// [lightColor] 浅色模式颜色
  static Color fixColor(Color darkColor, Color lightColor){
    return Get.isDarkMode ? darkColor : lightColor;
  }

}
